#include "stdafx.h"
#include "TestFailure.h"
#include "Test.h"

namespace JHCPP{
	namespace CppUnit{

		CTestFailure::CTestFailure(CTest* failedTest, CCppUnitException* thrownException)
		: m_failedTest(failedTest),
		m_thrownException(thrownException)
		{
		}

		CTestFailure::~CTestFailure()
		{ 
			delete m_thrownException;
		}

		CTest* CTestFailure::failedTest()
		{
			return m_failedTest;
		}

		CCppUnitException* CTestFailure::thrownException()
		{
			return m_thrownException;
		}

		std::string CTestFailure::toString()
		{
			return m_failedTest->toString () + ": " + m_thrownException->what();
		}
	}//end of namespace CppUnit
}//end of namespace JHCPP
